<%@ include file="../common/IncludeTop.jsp" %>

<h2>My Orders</h2>

<table>
    <tr>
        <th>Order ID</th>
        <th>Date</th>
        <th>Total Price</th>
    </tr>
    <c:if test="${sessionScope.orderList==null}">
        <b>${sessionScope.messsage}</b>
    </c:if>
    <c:if test="${sessionScope.orderList!=null}">
        <c:forEach var="order" items="${sessionScope.orderList}">
            <tr>
                <td>
                        <%-- todo 下面这个是购物车功能的 还没做 可以点--%>
                    <a href="viewOrderFromOrderList?orderId=${order.orderId}"> ${order.orderId}</a>
                </td>
                <td><fmt:formatDate value="${order.orderDate}"
                                    pattern="yyyy/MM/dd hh:mm:ss"/></td>
                <td><fmt:formatNumber value="${order.totalPrice}"
                                      pattern="$#,##0.00"/></td>
            </tr>
        </c:forEach>
    </c:if>
</table>

<%@ include file="../common/IncludeBottom.jsp" %>


